home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / memcntl.z / memcntl
Encoding:
Text File  |  2002-10-03  |  14.5 KB  |  265 lines

  1.  
  2.  
  3.  
  4. mmmmeeeemmmmccccnnnnttttllll((((2222))))                                                          mmmmeeeemmmmccccnnnnttttllll((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll - memory management control
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_mmmm_mmmm_aaaa_nnnn_...._hhhh_>>>>
  14.      _iiii_nnnn_tttt _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll_((((_vvvv_oooo_iiii_dddd _****_a_d_d_r_,,,, _ssss_iiii_zzzz_eeee______tttt _l_e_n_,,,, _iiii_nnnn_tttt _c_m_d_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_,,,,        _iiii_nnnn_tttt _a_t_t_r_,,,, _iiii_nnnn_tttt _m_a_s_k_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _N_O_T_E: _t_h_i_s _f_u_n_c_t_i_o_n _i_s _n_o_t _c_u_r_r_e_n_t_l_y _i_m_p_l_e_m_e_n_t_e_d _i_n _I_R_I_X.  _A_n_y _c_a_l_l_s _t_o
  18.      _t_h_i_s _f_u_n_c_t_i_o_n _w_i_l_l _r_e_t_u_r_n _E_N_O_S_Y_S.
  19.  
  20.      The function _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll allows the calling process to apply a variety of
  21.      control operations over the address space identified by the mappings
  22.      established for the address range [_a_d_d_r, _a_d_d_r + _l_e_n).
  23.  
  24.      _a_d_d_r must be a multiple of the pagesize as returned by _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff(3C).  The
  25.      scope of the control operations can be further defined with additional
  26.      selection criteria (in the form of attributes) according to the bit
  27.      pattern contained in _a_t_t_r.
  28.  
  29.      The following attributes specify page mapping selection criteria:
  30.  
  31.      _SSSS_HHHH_AAAA_RRRR_EEEE_DDDD     Page is mapped shared.
  32.      _PPPP_RRRR_IIII_VVVV_AAAA_TTTT_EEEE    Page is mapped private.
  33.  
  34.      The following attributes specify page protection selection criteria:
  35.  
  36.      _PPPP_RRRR_OOOO_TTTT______RRRR_EEEE_AAAA_DDDD    Page can be read.
  37.      _PPPP_RRRR_OOOO_TTTT______WWWW_RRRR_IIII_TTTT_EEEE   Page can be written.
  38.      _PPPP_RRRR_OOOO_TTTT______EEEE_XXXX_EEEE_CCCC    Page can be executed.
  39.  
  40.      The selection criteria are constructed by an OR of the attribute bits and
  41.      must match exactly.
  42.  
  43.      In addition, the following criteria may be specified:
  44.  
  45.      _PPPP_RRRR_OOOO_CCCC______TTTT_EEEE_XXXX_TTTT   process text
  46.      _PPPP_RRRR_OOOO_CCCC______DDDD_AAAA_TTTT_AAAA   process data
  47.      where _PPPP_RRRR_OOOO_CCCC______TTTT_EEEE_XXXX_TTTT specifies all privately mapped segments with read and
  48.      execute permission, and _PPPP_RRRR_OOOO_CCCC______DDDD_AAAA_TTTT_AAAA specifies all privately mapped segments
  49.      with write permission.
  50.  
  51.      Selection criteria can be used to describe various abstract memory
  52.      objects within the address space on which to operate.  If an operation
  53.      shall not be constrained by the selection criteria, _a_t_t_r must have the
  54.      value _0000.
  55.  
  56.      The operation to be performed is identified by the argument _c_m_d.  The
  57.      symbolic names for the operations are defined in _<<<<_ssss_yyyy_ssss_////_mmmm_mmmm_aaaa_nnnn_...._hhhh_>>>> as follows:
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mmmmeeeemmmmccccnnnnttttllll((((2222))))                                                          mmmmeeeemmmmccccnnnnttttllll((((2222))))
  71.  
  72.  
  73.  
  74.      _MMMM_CCCC______LLLL_OOOO_CCCC_KKKK   Lock in memory all pages in the range with attributes _a_t_t_r.  A
  75.                given page may be locked multiple times through different
  76.                mappings; however, within a given mapping, page locks do not
  77.                nest.  Multiple lock operations on the same address in the same
  78.                process will all be removed with a single unlock operation.  A
  79.                page locked in one process and mapped in another (or visible
  80.                through a different mapping in the locking process) is locked
  81.                in memory as long as the locking process does neither an
  82.                implicit nor explicit unlock operation.  If a locked mapping is
  83.                removed, or a page is deleted through file removal or
  84.                truncation, an unlock operation is implicitly performed.  If a
  85.                writable _MMMM_AAAA_PPPP______PPPP_RRRR_IIII_VVVV_AAAA_TTTT_EEEE page in the address range is changed, the
  86.                lock will be transferred to the private page.
  87.  
  88.                At present _a_r_g is unused, but must be _0000 to ensure compatibility
  89.                with potential future enhancements.
  90.  
  91.      _MMMM_CCCC______LLLL_OOOO_CCCC_KKKK_AAAA_SSSS Lock in memory all pages mapped by the address space with
  92.                attributes _a_t_t_r.  At present _a_d_d_r and _l_e_n are unused, but must
  93.                be _NNNN_UUUU_LLLL_LLLL and _0000 respectively, to ensure compatibility with
  94.                potential future enhancements.  _a_r_g is a bit pattern built from
  95.                the flags:
  96.                   _MMMM_CCCC_LLLL______CCCC_UUUU_RRRR_RRRR_EEEE_NNNN_TTTT   Lock current mappings
  97.                   _MMMM_CCCC_LLLL______FFFF_UUUU_TTTT_UUUU_RRRR_EEEE    Lock future mappings
  98.  
  99.                The value of _a_r_g determines whether the pages to be locked are
  100.                those currently mapped by the address space, those that will be
  101.                mapped in the future, or both.  If _MMMM_CCCC_LLLL______FFFF_UUUU_TTTT_UUUU_RRRR_EEEE is specified,
  102.                then all mappings subsequently added to the address space will
  103.                be locked, provided sufficient memory is available.
  104.  
  105.      _MMMM_CCCC______SSSS_YYYY_NNNN_CCCC   Write to their backing storage locations all modified pages in
  106.                the range with attributes _a_t_t_r.  Optionally, invalidate cache
  107.                copies.  The backing storage for a modified _MMMM_AAAA_PPPP______SSSS_HHHH_AAAA_RRRR_EEEE_DDDD mapping
  108.                is the file the page is mapped to; the backing storage for a
  109.                modified _MMMM_AAAA_PPPP______PPPP_RRRR_IIII_VVVV_AAAA_TTTT_EEEE mapping is its swap area.  _a_r_g is a bit
  110.                pattern built from the flags used to control the behavior of
  111.                the operation:
  112.                   _MMMM_SSSS______AAAA_SSSS_YYYY_NNNN_CCCC        perform asynchronous writes
  113.                   _MMMM_SSSS______SSSS_YYYY_NNNN_CCCC         perform synchronous writes
  114.                   _MMMM_SSSS______IIII_NNNN_VVVV_AAAA_LLLL_IIII_DDDD_AAAA_TTTT_EEEE   invalidate mappings
  115.  
  116.                _MMMM_SSSS______AAAA_SSSS_YYYY_NNNN_CCCC returns immediately once all write operations are
  117.                scheduled; with _MMMM_SSSS______SSSS_YYYY_NNNN_CCCC the system call will not return until
  118.                all write operations are completed.
  119.  
  120.                _MMMM_SSSS______IIII_NNNN_VVVV_AAAA_LLLL_IIII_DDDD_AAAA_TTTT_EEEE invalidates all cached copies of data in memory,
  121.                so that further references to the pages will be obtained by the
  122.                system from their backing storage locations.  This operation
  123.                should be used by applications that require a memory object to
  124.                be in a known state.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. mmmmeeeemmmmccccnnnnttttllll((((2222))))                                                          mmmmeeeemmmmccccnnnnttttllll((((2222))))
  137.  
  138.  
  139.  
  140.      _MMMM_CCCC______UUUU_NNNN_LLLL_OOOO_CCCC_KKKK Unlock all pages in the range with attributes _a_t_t_r.  At present
  141.                _a_r_g is unused, but must be _0000 to ensure compatibility with
  142.                potential future enhancements.
  143.  
  144.      _MMMM_CCCC______UUUU_NNNN_LLLL_OOOO_CCCC_KKKK_AAAA_SSSS
  145.                Remove address space memory locks, and locks on all pages in
  146.                the address space with attributes _a_t_t_r.  At present _a_d_d_r, _l_e_n,
  147.                and _a_r_g are unused, but must be _NNNN_UUUU_LLLL_LLLL, _0000 and _0000 respectively, to
  148.                ensure compatibility with potential future enhancements.
  149.  
  150.      The _m_a_s_k argument must be zero; it is reserved for future use.
  151.  
  152.      Locks established with the lock operations are not inherited by a child
  153.      process after _ffff_oooo_rrrr_kkkk.  _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll fails if it attempts to lock more memory
  154.      than a system-specific limit.
  155.  
  156.      Due to the potential impact on system resources, all operations, with the
  157.      exception of _MMMM_CCCC______SSSS_YYYY_NNNN_CCCC, are restricted to processes with appropriate
  158.      privileges (_PPPP______PPPP_LLLL_OOOO_CCCC_KKKK).
  159.  
  160.      The _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll function subsumes the operations of _pppp_llll_oooo_cccc_kkkk and _mmmm_cccc_tttt_llll.
  161.  
  162. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  163.      On success, _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll returns _0000; on failure, _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll returns _----_1111 and sets
  164.      _eeee_rrrr_rrrr_nnnn_oooo to indicate an error.
  165.  
  166. EEEERRRRRRRROOOORRRRSSSS
  167.      Under the following conditions, the function _mmmm_eeee_mmmm_cccc_nnnn_tttt_llll fails and sets _eeee_rrrr_rrrr_nnnn_oooo
  168.      to:
  169.  
  170.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN      Some or all of the memory identified by the operation could
  171.                  not be locked when _MMMM_CCCC______LLLL_OOOO_CCCC_KKKK or _MMMM_CCCC______LLLL_OOOO_CCCC_KKKK_AAAA_SSSS is specified.
  172.  
  173.      _EEEE_BBBB_UUUU_SSSS_YYYY       Some or all the addresses in the range [_a_d_d_r, _a_d_d_r + _l_e_n) are
  174.                  locked and _MMMM_CCCC______SSSS_YYYY_NNNN_CCCC with _MMMM_SSSS______IIII_NNNN_VVVV_AAAA_LLLL_IIII_DDDD_AAAA_TTTT_EEEE option is specified.
  175.  
  176.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT      The page to be locked has been aborted (e.g.  by a file
  177.                  truncate operation), or pages following the end of an object
  178.                  are not allocated.
  179.  
  180.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL      _a_d_d_r is not a multiple of the page size as returned by
  181.                  _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff.
  182.  
  183.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL      _a_d_d_r and/or _l_e_n do not have the value _0000 when _MMMM_CCCC______LLLL_OOOO_CCCC_KKKK_AAAA_SSSS or
  184.                  _MMMM_CCCC______UUUU_NNNN_LLLL_OOOO_CCCC_KKKK_AAAA_SSSS is specified.
  185.  
  186.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL      _a_r_g is not valid for the function specified.
  187.  
  188.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL      Invalid selection criteria are specified in _a_t_t_r.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. mmmmeeeemmmmccccnnnnttttllll((((2222))))                                                          mmmmeeeemmmmccccnnnnttttllll((((2222))))
  203.  
  204.  
  205.  
  206.      _EEEE_IIII_OOOO         An I/O error occurred when attempting to read the page from a
  207.                  device or a network.
  208.  
  209.      _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM      The argument _l_e_n has a value less than or equal to _0000.
  210.  
  211.      _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM      Some or all the addresses in the range [_a_d_d_r, _a_d_d_r + _l_e_n) are
  212.                  invalid for the address space of the process or pages not
  213.                  mapped are specified.
  214.  
  215.      _EEEE_PPPP_EEEE_RRRR_MMMM       The process does not have appropriate privilege (_PPPP______PPPP_LLLL_OOOO_CCCC_KKKK) and
  216.                  one of _MMMM_CCCC______LLLL_OOOO_CCCC_KKKK, _MMMM_CCCC______LLLL_OOOO_CCCC_KKKK_AAAA_SSSS, _MMMM_CCCC______UUUU_NNNN_LLLL_OOOO_CCCC_KKKK, _MMMM_CCCC______UUUU_NNNN_LLLL_OOOO_CCCC_KKKK_AAAA_SSSS was
  217.                  specified.
  218.  
  219. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  220.      mmap(2), mprotect(2), plock(2), mlock(3C), mlockall(3C), msync(3C),
  221.      sysconf(3C)
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.